import React from 'react';
import { connect } from 'dva';

import styles from './approval.less'
import approvalImg from '@/assets/image/dtimage/approval.png'
import downIcon from '../../assets/image/xl.svg'
class Approval extends React.Component {
  render() {
    const { approvalTimes, approvalPassRate, avgApprovalDuration } = this.props
    return (
      <div className={styles.bg}>
        <img className={styles.downIcon} src={downIcon} alt='' />
        <div className={styles.box}>
          <div className={styles.title}>2019.08.03 工作台审批上线</div>
          <div className={styles.textBox}>
            <div>你一共发起过<span className={styles.textColor}>{approvalTimes || ''}</span>次审批</div>
            <div>审批通过率达<span className={styles.textColor}>{Number((approvalPassRate || '') * 100).toFixed(1)}%</span></div>
            <div>平均审批时长<span className={styles.textColor}>{Number(avgApprovalDuration || '').toFixed(1)}</span>小时</div>
            <div className={styles.border}></div>
            <div>随时随地，便捷办公，一“触”而就～</div>
          </div>
          <div className={styles.imgBox}>
            <img className={styles.img} src={approvalImg} alt=""></img>
            <div className={styles.seal}></div>
          </div>

        </div>
      </div>
    )
  }
}

export default connect(({ index }) => index.approval)(Approval)